package com.zyx.strategy.stg05;

import org.springframework.beans.factory.InitializingBean;

import javax.annotation.Resource;

/**
 * <p>将实现了AbstractFiveHandler的类自动注册到容器中
 *
 * @author Yaxi.Zhang
 * @since 2022/10/10 01:16
 */
public abstract class AbstractFiveHandler implements InitializingBean {

    @Resource
    private FiveHandlerContext fiveHandlerContext;

    @Override
    public void afterPropertiesSet() throws Exception {
        fiveHandlerContext.register(this);
    }

    public abstract void handle();
    public abstract String getType();
}
